local mingce = fk.CreateSkill {

  name = "joy__mingce",

  tags = {  },

}



mingce:addEffect(fk.EventPhaseStart, {
  name = "joy__mingce",
  anim_type = "offensive",
  events = {fk.EventPhaseStart},
  can_trigger = function(self, event, target, player, data)
    if target == player and player:hasSkill(mingce.name) and player.phase == Player.Play then
      local players = player.room.alive_players
      return #players > 1
    end
  end,
  on_cost = function (self, event, target, player, data)
    local room = player.room
    local success, dat = room:askForUseActiveSkill(player, "joy__mingce_choose", "#joy__mingce-promot", true, nil, true)
    if success and dat then
      event:setCostData(self, dat.targets)
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local victim = room:getPlayerById(event:getCostData(self)[2])
    local bro = room:getPlayerById(event:getCostData(self)[1])
    room:doIndicate(player.id, {bro.id})
    if  not bro:prohibitUse(Fk:cloneCard("slash")) and not bro:isProhibited(victim, Fk:cloneCard("slash"))then
      room:useVirtualCard("slash", nil, bro, victim, mingce.name, true)
    end
  end,
})

return mingce